<template>
  <div id="app">
    <header v-if="isAuthenticated">
      <nav class="main-nav">
        <router-link to="/" class="logo">
          WeKanKan
        </router-link>
        <GlobalSearch />
        <div class="nav-right">
          <NotificationCenter />
          <Avatar 
            :user="currentUser"
            @click="showUserMenu = !showUserMenu"
          />
        </div>
      </nav>
    </header>

    <main>
      <router-view></router-view>
    </main>

    <ThemeSettings v-if="showThemeSettings" />
    <ShortcutsModal v-if="showShortcuts" />
  </div>
</template>

<script setup>
import { ref, computed } from 'vue';
import { useAuthStore } from './stores/auth';
import GlobalSearch from './components/Search/GlobalSearch.vue';
import NotificationCenter from './components/Notification/NotificationCenter.vue';
import Avatar from './components/Common/Avatar.vue';
import ThemeSettings from './components/Settings/ThemeSettings.vue';
import ShortcutsModal from './components/Common/ShortcutsModal.vue';

const authStore = useAuthStore();
const showUserMenu = ref(false);
const showThemeSettings = ref(false);
const showShortcuts = ref(false);

const isAuthenticated = computed(() => authStore.isAuthenticated);
const currentUser = computed(() => authStore.user);
</script>

<style>
#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-nav {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0,0,0,0.1);
}

.logo {
  font-size: 20px;
  font-weight: bold;
  color: white;
  text-decoration: none;
  margin-right: 16px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

main {
  flex: 1;
  overflow: auto;
}
</style> 